package com.uc3m.dsic.gestorZoo;

import java.awt.event.*;
import javax.swing.*;

/**
 * Clase que va a ejecutar el menú de las gestión de las tablas que se encargará
 * de gestionar cada una de las inserciones borrado y actualizaciones de cada
 * una de las tablas, sacando por pantalla una interfaz de usuario para
 * mostrarlo.
 *
 * @author Javier Roca García
 */
public class GestionTablas extends JFrame {

    /** Creates new form NewJFrame */
    public GestionTablas() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane3 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel3 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        tbAnimalPais = new javax.swing.JTextField();
        tbAnimalSala = new javax.swing.JTextField();
        tbAnimalEdad = new javax.swing.JTextField();
        tbAnimalNombre = new javax.swing.JTextField();
        tbAnimalEspecie = new javax.swing.JTextField();
        bAnimalAnyadir = new javax.swing.JButton();
        bAnimalModificar = new javax.swing.JButton();
        bAnimalBorrar = new javax.swing.JButton();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbAnimalDescripcion = new javax.swing.JEditorPane();
        tbAnimalExtincion = new javax.swing.JComboBox();
        tbAnimalEnfermedad = new javax.swing.JComboBox();
        jPanel2 = new javax.swing.JPanel();
        bZooAnyadir = new javax.swing.JButton();
        tbIdZoo = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        tbZooNombre = new javax.swing.JTextField();
        tbZooCiudad = new javax.swing.JTextField();
        tbZooAforo = new javax.swing.JTextField();
        tbZooPais = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        bZooBorrar = new javax.swing.JButton();
        bZooModificar = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        tbZooIdioma = new javax.swing.JTextField();
        jLabel40 = new javax.swing.JLabel();
        tbZooEntradas = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        tbEmpleadoEdad = new javax.swing.JTextField();
        tbEmpleadoTelefono = new javax.swing.JTextField();
        tbEmpleadoApellido2 = new javax.swing.JTextField();
        tbEmpleadoApellido1 = new javax.swing.JTextField();
        tbEmpleadoNombre = new javax.swing.JTextField();
        tbEmpleadoId = new javax.swing.JTextField();
        bEmpleadoAnyadir = new javax.swing.JButton();
        bEmpleadoModificar = new javax.swing.JButton();
        bEmpleadoBorrar = new javax.swing.JButton();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        tbEmpleadoEspecialidad = new javax.swing.JComboBox();
        tbEmpleadoEstado = new javax.swing.JComboBox();
        jPanel6 = new javax.swing.JPanel();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        tbTicketZoo = new javax.swing.JTextField();
        tbTicketPrecio = new javax.swing.JTextField();
        bTicketAnyadir = new javax.swing.JButton();
        bTicketModificar = new javax.swing.JButton();
        bTicketBorrar = new javax.swing.JButton();
        tbTicketTipo = new javax.swing.JComboBox();
        jPanel7 = new javax.swing.JPanel();
        jLabel34 = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        tbHorarioAnimal = new javax.swing.JTextField();
        tbHorarioHora = new javax.swing.JTextField();
        tbHorarioEspecie = new javax.swing.JTextField();
        bHorarioAnyadir = new javax.swing.JButton();
        bHorarioModificar = new javax.swing.JButton();
        bHorarioBorrar = new javax.swing.JButton();
        jLabel39 = new javax.swing.JLabel();
        tbHorarioTipoComida = new javax.swing.JComboBox();
        jLabel41 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        tbSalaZoo = new javax.swing.JTextField();
        tbSalaAforo = new javax.swing.JTextField();
        tbSalaNombre = new javax.swing.JTextField();
        tbSalaId = new javax.swing.JTextField();
        bSalaAnyadir = new javax.swing.JButton();
        bSalaModificar = new javax.swing.JButton();
        bSalaBorrar = new javax.swing.JButton();
        bIrConsultas = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jTabbedPane1.setTabPlacement(javax.swing.JTabbedPane.BOTTOM);

        jLabel8.setFont(new java.awt.Font("Tahoma", 1, 36));
        jLabel8.setText("Animal");

        jLabel9.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel9.setText("Especie");

        jLabel10.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel10.setText("Nombre");

        jLabel11.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel11.setText("Edad");

        jLabel12.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel12.setText("Localización Sala");

        jLabel13.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel13.setText("País de Origen");

        jLabel14.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel14.setText("Extinción");

        tbAnimalPais.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbAnimalPais.setMaximumSize(new java.awt.Dimension(72, 23));
        tbAnimalPais.setMinimumSize(new java.awt.Dimension(72, 23));

        tbAnimalSala.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbAnimalSala.setMaximumSize(new java.awt.Dimension(72, 23));
        tbAnimalSala.setMinimumSize(new java.awt.Dimension(72, 23));

        tbAnimalEdad.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbAnimalEdad.setMaximumSize(new java.awt.Dimension(72, 23));
        tbAnimalEdad.setMinimumSize(new java.awt.Dimension(72, 23));

        tbAnimalNombre.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbAnimalNombre.setMaximumSize(new java.awt.Dimension(72, 23));
        tbAnimalNombre.setMinimumSize(new java.awt.Dimension(72, 23));

        tbAnimalEspecie.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbAnimalEspecie.setMaximumSize(new java.awt.Dimension(72, 23));
        tbAnimalEspecie.setMinimumSize(new java.awt.Dimension(72, 23));

        bAnimalAnyadir.setFont(new java.awt.Font("Tahoma", 0, 14));
        bAnimalAnyadir.setText("Añadir");
        bAnimalAnyadir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bAnimalAnyadirActionPerformed(evt);
            }
        });

        bAnimalModificar.setFont(new java.awt.Font("Tahoma", 0, 14));
        bAnimalModificar.setText("Modificar");
        bAnimalModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bAnimalModificarActionPerformed(evt);
            }
        });

        bAnimalBorrar.setFont(new java.awt.Font("Tahoma", 0, 14));
        bAnimalBorrar.setText("Borrar");
        bAnimalBorrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bAnimalBorrarActionPerformed(evt);
            }
        });

        jLabel15.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel15.setText("Enfermedad");

        jLabel16.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel16.setText("Descripción");

        tbAnimalDescripcion.setFont(new java.awt.Font("Tahoma", 0, 14));
        jScrollPane1.setViewportView(tbAnimalDescripcion);

        tbAnimalExtincion.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbAnimalExtincion.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "---", "SI", "NO" }));

        tbAnimalEnfermedad.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbAnimalEnfermedad.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "---", "SI", "NO" }));

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(142, 142, 142)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(211, 211, 211))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel9)
                            .addComponent(jLabel10)
                            .addComponent(jLabel11)
                            .addComponent(jLabel12)
                            .addComponent(jLabel13)
                            .addComponent(jLabel14)
                            .addComponent(jLabel15)
                            .addComponent(jLabel16))
                        .addGap(47, 47, 47)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 322, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addContainerGap())
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(tbAnimalEnfermedad, javax.swing.GroupLayout.Alignment.LEADING, 0, 85, Short.MAX_VALUE)
                                    .addComponent(tbAnimalExtincion, javax.swing.GroupLayout.Alignment.LEADING, 0, 85, Short.MAX_VALUE)
                                    .addComponent(tbAnimalEdad, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)
                                    .addComponent(tbAnimalSala, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)
                                    .addComponent(tbAnimalPais, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)
                                    .addComponent(tbAnimalNombre, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)
                                    .addComponent(tbAnimalEspecie, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE))
                                .addGap(59, 59, 59)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(bAnimalModificar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(bAnimalAnyadir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(bAnimalBorrar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addGap(103, 103, 103))))))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel8)
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9)
                            .addComponent(tbAnimalEspecie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbAnimalNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbAnimalEdad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel11))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbAnimalSala, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel12))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbAnimalPais, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel13))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel14)
                            .addComponent(tbAnimalExtincion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel15)
                            .addComponent(tbAnimalEnfermedad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(41, 41, 41)
                        .addComponent(bAnimalAnyadir)
                        .addGap(18, 18, 18)
                        .addComponent(bAnimalModificar)
                        .addGap(18, 18, 18)
                        .addComponent(bAnimalBorrar)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel16)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        jTabbedPane1.addTab("Animal", jPanel3);

        bZooAnyadir.setFont(new java.awt.Font("Tahoma", 0, 14));
        bZooAnyadir.setText("Añadir");
        bZooAnyadir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bZooAnyadirActionPerformed(evt);
            }
        });

        tbIdZoo.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbIdZoo.setMaximumSize(new java.awt.Dimension(72, 23));
        tbIdZoo.setMinimumSize(new java.awt.Dimension(72, 23));

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel1.setText("Identificador");

        tbZooNombre.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbZooNombre.setMaximumSize(new java.awt.Dimension(72, 23));
        tbZooNombre.setMinimumSize(new java.awt.Dimension(72, 23));

        tbZooCiudad.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbZooCiudad.setMaximumSize(new java.awt.Dimension(72, 23));
        tbZooCiudad.setMinimumSize(new java.awt.Dimension(72, 23));

        tbZooAforo.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbZooAforo.setMaximumSize(new java.awt.Dimension(72, 23));
        tbZooAforo.setMinimumSize(new java.awt.Dimension(72, 23));

        tbZooPais.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbZooPais.setMaximumSize(new java.awt.Dimension(72, 23));
        tbZooPais.setMinimumSize(new java.awt.Dimension(72, 23));

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel2.setText("Nombre");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel3.setText("Ciudad");

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel4.setText("Aforo");

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel5.setText("País");

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel6.setText("Entradas Vendidas");

        bZooBorrar.setFont(new java.awt.Font("Tahoma", 0, 14));
        bZooBorrar.setText("Borrar");
        bZooBorrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bZooBorrarActionPerformed(evt);
            }
        });

        bZooModificar.setFont(new java.awt.Font("Tahoma", 0, 14));
        bZooModificar.setText("Modificar");
        bZooModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bZooModificarActionPerformed(evt);
            }
        });

        jLabel7.setFont(new java.awt.Font("Tahoma", 1, 36));
        jLabel7.setText("Zoo");

        tbZooIdioma.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbZooIdioma.setMaximumSize(new java.awt.Dimension(72, 23));
        tbZooIdioma.setMinimumSize(new java.awt.Dimension(72, 23));

        jLabel40.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel40.setText("Idioma");

        tbZooEntradas.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbZooEntradas.setMaximumSize(new java.awt.Dimension(72, 23));
        tbZooEntradas.setMinimumSize(new java.awt.Dimension(72, 23));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(243, 243, 243)
                        .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(63, 63, 63)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel40)
                            .addComponent(jLabel5)
                            .addComponent(jLabel4)
                            .addComponent(jLabel3)
                            .addComponent(jLabel2)
                            .addComponent(jLabel1)
                            .addComponent(jLabel6))
                        .addGap(20, 20, 20)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(tbZooEntradas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(tbZooIdioma, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(tbZooNombre, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(tbIdZoo, javax.swing.GroupLayout.DEFAULT_SIZE, 144, Short.MAX_VALUE)
                            .addComponent(tbZooCiudad, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(tbZooAforo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(tbZooPais, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(bZooModificar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(bZooAnyadir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(bZooBorrar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addGap(185, 185, 185))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addComponent(jLabel7)
                .addGap(44, 44, 44)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(bZooAnyadir)
                        .addGap(18, 18, 18)
                        .addComponent(bZooModificar)
                        .addGap(18, 18, 18)
                        .addComponent(bZooBorrar)
                        .addGap(27, 27, 27))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(tbIdZoo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(tbZooNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(tbZooCiudad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(tbZooAforo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(tbZooPais, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel40)
                            .addComponent(tbZooIdioma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbZooEntradas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addGap(49, 49, 49))
        );

        jTabbedPane1.addTab("Zoo", jPanel2);

        jLabel17.setFont(new java.awt.Font("Tahoma", 1, 36));
        jLabel17.setText("Empleado");

        jLabel18.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel18.setText("Identificador");

        jLabel19.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel19.setText("Nombre");

        jLabel20.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel20.setText("Apellido1");

        jLabel21.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel21.setText("Apellido2");

        jLabel22.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel22.setText("Teléfono");

        jLabel23.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel23.setText("Edad");

        tbEmpleadoEdad.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbEmpleadoEdad.setMaximumSize(new java.awt.Dimension(72, 23));
        tbEmpleadoEdad.setMinimumSize(new java.awt.Dimension(72, 23));

        tbEmpleadoTelefono.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbEmpleadoTelefono.setMaximumSize(new java.awt.Dimension(72, 23));
        tbEmpleadoTelefono.setMinimumSize(new java.awt.Dimension(72, 23));

        tbEmpleadoApellido2.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbEmpleadoApellido2.setMaximumSize(new java.awt.Dimension(72, 23));
        tbEmpleadoApellido2.setMinimumSize(new java.awt.Dimension(72, 23));

        tbEmpleadoApellido1.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbEmpleadoApellido1.setMaximumSize(new java.awt.Dimension(72, 23));
        tbEmpleadoApellido1.setMinimumSize(new java.awt.Dimension(72, 23));

        tbEmpleadoNombre.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbEmpleadoNombre.setMaximumSize(new java.awt.Dimension(72, 23));
        tbEmpleadoNombre.setMinimumSize(new java.awt.Dimension(72, 23));

        tbEmpleadoId.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbEmpleadoId.setMaximumSize(new java.awt.Dimension(72, 23));
        tbEmpleadoId.setMinimumSize(new java.awt.Dimension(72, 23));

        bEmpleadoAnyadir.setFont(new java.awt.Font("Tahoma", 0, 14));
        bEmpleadoAnyadir.setText("Añadir");
        bEmpleadoAnyadir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bEmpleadoAnyadirActionPerformed(evt);
            }
        });

        bEmpleadoModificar.setFont(new java.awt.Font("Tahoma", 0, 14));
        bEmpleadoModificar.setText("Modificar");
        bEmpleadoModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bEmpleadoModificarActionPerformed(evt);
            }
        });

        bEmpleadoBorrar.setFont(new java.awt.Font("Tahoma", 0, 14));
        bEmpleadoBorrar.setText("Borrar");
        bEmpleadoBorrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bEmpleadoBorrarActionPerformed(evt);
            }
        });

        jLabel24.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel24.setText("Especialidad");

        jLabel25.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel25.setText("Estado");

        tbEmpleadoEspecialidad.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbEmpleadoEspecialidad.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "---", "Cuidador", "Nutricionista", "Veterinario", "Domador" }));

        tbEmpleadoEstado.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbEmpleadoEstado.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "---", "Alta", "Baja", "Vacaciones" }));

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(184, 184, 184)
                .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(85, 85, 85)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel18)
                    .addComponent(jLabel19)
                    .addComponent(jLabel20)
                    .addComponent(jLabel21)
                    .addComponent(jLabel22)
                    .addComponent(jLabel23)
                    .addComponent(jLabel24)
                    .addComponent(jLabel25))
                .addGap(47, 47, 47)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tbEmpleadoEstado, 0, 119, Short.MAX_VALUE)
                    .addComponent(tbEmpleadoEspecialidad, 0, 119, Short.MAX_VALUE)
                    .addComponent(tbEmpleadoApellido1, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)
                    .addComponent(tbEmpleadoApellido2, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)
                    .addComponent(tbEmpleadoTelefono, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)
                    .addComponent(tbEmpleadoNombre, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)
                    .addComponent(tbEmpleadoEdad, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)
                    .addComponent(tbEmpleadoId, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE))
                .addGap(59, 59, 59)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(bEmpleadoModificar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bEmpleadoAnyadir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bEmpleadoBorrar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(90, 90, 90))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel17)
                .addGap(37, 37, 37)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel18)
                            .addComponent(tbEmpleadoId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbEmpleadoNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel19))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbEmpleadoApellido1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel20))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbEmpleadoApellido2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel21))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbEmpleadoTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel22))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbEmpleadoEdad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel23))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel24)
                            .addComponent(tbEmpleadoEspecialidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(41, 41, 41)
                        .addComponent(bEmpleadoAnyadir)
                        .addGap(18, 18, 18)
                        .addComponent(bEmpleadoModificar)
                        .addGap(18, 18, 18)
                        .addComponent(bEmpleadoBorrar)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel25)
                    .addComponent(tbEmpleadoEstado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(45, 45, 45))
        );

        jTabbedPane1.addTab("Cuidador", jPanel4);

        jLabel31.setFont(new java.awt.Font("Tahoma", 1, 36));
        jLabel31.setText("Ticket");

        jLabel32.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel32.setText("Tipo");

        jLabel33.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel33.setText("Precio");

        jLabel35.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel35.setText("ID del Zoo al que pertenece");

        tbTicketZoo.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbTicketZoo.setMaximumSize(new java.awt.Dimension(72, 23));
        tbTicketZoo.setMinimumSize(new java.awt.Dimension(72, 23));

        tbTicketPrecio.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbTicketPrecio.setMaximumSize(new java.awt.Dimension(72, 23));
        tbTicketPrecio.setMinimumSize(new java.awt.Dimension(72, 23));

        bTicketAnyadir.setFont(new java.awt.Font("Tahoma", 0, 14));
        bTicketAnyadir.setText("Añadir");
        bTicketAnyadir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bTicketAnyadirActionPerformed(evt);
            }
        });

        bTicketModificar.setFont(new java.awt.Font("Tahoma", 0, 14));
        bTicketModificar.setText("Modificar");
        bTicketModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bTicketModificarActionPerformed(evt);
            }
        });

        bTicketBorrar.setFont(new java.awt.Font("Tahoma", 0, 14));
        bTicketBorrar.setText("Borrar");
        bTicketBorrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bTicketBorrarActionPerformed(evt);
            }
        });

        tbTicketTipo.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbTicketTipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "---", "Joven", "Adulto", "Grupo" }));

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel6Layout.createSequentialGroup()
                        .addComponent(jLabel35)
                        .addGap(25, 25, 25)
                        .addComponent(tbTicketZoo, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel6Layout.createSequentialGroup()
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel32)
                            .addComponent(jLabel33))
                        .addGap(173, 173, 173)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(tbTicketPrecio, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(tbTicketTipo, 0, 171, Short.MAX_VALUE))))
                .addGap(27, 27, 27)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(bTicketModificar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bTicketAnyadir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bTicketBorrar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(114, 114, 114))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap(218, Short.MAX_VALUE)
                .addComponent(jLabel31, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(206, 206, 206))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGap(32, 32, 32)
                .addComponent(jLabel31)
                .addGap(1, 1, 1)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGap(69, 69, 69)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbTicketZoo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel35))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel32)
                            .addComponent(tbTicketTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel33)
                            .addComponent(tbTicketPrecio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGap(51, 51, 51)
                        .addComponent(bTicketAnyadir)
                        .addGap(18, 18, 18)
                        .addComponent(bTicketModificar)
                        .addGap(18, 18, 18)
                        .addComponent(bTicketBorrar)))
                .addContainerGap(118, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Ticket", jPanel6);

        jLabel34.setFont(new java.awt.Font("Tahoma", 1, 36));
        jLabel34.setText("Horario");

        jLabel36.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel36.setText("Especie");

        jLabel37.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel37.setText("Hora *");

        jLabel38.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel38.setText("Nombre del Animal");

        tbHorarioAnimal.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbHorarioAnimal.setMaximumSize(new java.awt.Dimension(72, 23));
        tbHorarioAnimal.setMinimumSize(new java.awt.Dimension(72, 23));

        tbHorarioHora.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbHorarioHora.setMaximumSize(new java.awt.Dimension(72, 23));
        tbHorarioHora.setMinimumSize(new java.awt.Dimension(72, 23));

        tbHorarioEspecie.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbHorarioEspecie.setMaximumSize(new java.awt.Dimension(72, 23));
        tbHorarioEspecie.setMinimumSize(new java.awt.Dimension(72, 23));

        bHorarioAnyadir.setFont(new java.awt.Font("Tahoma", 0, 14));
        bHorarioAnyadir.setText("Añadir");
        bHorarioAnyadir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bHorarioAnyadirActionPerformed(evt);
            }
        });

        bHorarioModificar.setFont(new java.awt.Font("Tahoma", 0, 14));
        bHorarioModificar.setText("Modificar");
        bHorarioModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bHorarioModificarActionPerformed(evt);
            }
        });

        bHorarioBorrar.setFont(new java.awt.Font("Tahoma", 0, 14));
        bHorarioBorrar.setText("Borrar");
        bHorarioBorrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bHorarioBorrarActionPerformed(evt);
            }
        });

        jLabel39.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel39.setText("Tipo de Comida");

        tbHorarioTipoComida.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbHorarioTipoComida.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "---", "Lacteos", "Carne", "Pescado", "Frutas", "Potitos", "Cereales" }));

        jLabel41.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel41.setText("* La hora debe tener un formato XX:XX");

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addContainerGap(98, Short.MAX_VALUE)
                .addComponent(jLabel34, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(255, 255, 255))
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(122, 122, 122)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel38)
                    .addComponent(jLabel36)
                    .addComponent(jLabel37)
                    .addComponent(jLabel39))
                .addGap(25, 25, 25)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(tbHorarioTipoComida, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(tbHorarioEspecie, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(tbHorarioHora, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(tbHorarioAnimal, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE))
                .addGap(40, 40, 40)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(bHorarioModificar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bHorarioAnyadir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bHorarioBorrar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(81, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addContainerGap(346, Short.MAX_VALUE)
                .addComponent(jLabel41)
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addComponent(jLabel34)
                .addGap(70, 70, 70)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbHorarioAnimal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel38))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel36)
                            .addComponent(tbHorarioEspecie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel37)
                            .addComponent(tbHorarioHora, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel39)
                            .addComponent(tbHorarioTipoComida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(1, 1, 1)
                        .addComponent(bHorarioAnyadir)
                        .addGap(18, 18, 18)
                        .addComponent(bHorarioModificar)
                        .addGap(18, 18, 18)
                        .addComponent(bHorarioBorrar)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 90, Short.MAX_VALUE)
                .addComponent(jLabel41))
        );

        jTabbedPane1.addTab("Horario", jPanel7);

        jLabel26.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N
        jLabel26.setText("Sala");

        jLabel27.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel27.setText("Identificador Sala");

        jLabel28.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel28.setText("Nombre");

        jLabel29.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel29.setText("Aforo Sala");

        jLabel30.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel30.setText("ID del Zoo al que pertenece");

        tbSalaZoo.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbSalaZoo.setMaximumSize(new java.awt.Dimension(72, 23));
        tbSalaZoo.setMinimumSize(new java.awt.Dimension(72, 23));

        tbSalaAforo.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbSalaAforo.setMaximumSize(new java.awt.Dimension(72, 23));
        tbSalaAforo.setMinimumSize(new java.awt.Dimension(72, 23));

        tbSalaNombre.setFont(new java.awt.Font("Tahoma", 0, 14));
        tbSalaNombre.setMaximumSize(new java.awt.Dimension(72, 23));
        tbSalaNombre.setMinimumSize(new java.awt.Dimension(72, 23));

        tbSalaId.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        tbSalaId.setMaximumSize(new java.awt.Dimension(72, 23));
        tbSalaId.setMinimumSize(new java.awt.Dimension(72, 23));

        bSalaAnyadir.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        bSalaAnyadir.setText("Añadir");
        bSalaAnyadir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bSalaAnyadirActionPerformed(evt);
            }
        });

        bSalaModificar.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        bSalaModificar.setText("Modificar");
        bSalaModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bSalaModificarActionPerformed(evt);
            }
        });

        bSalaBorrar.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        bSalaBorrar.setText("Borrar");
        bSalaBorrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bSalaBorrarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(42, 42, 42)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel29)
                    .addComponent(jLabel30)
                    .addComponent(jLabel28)
                    .addComponent(jLabel27))
                .addGap(8, 8, 8)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(tbSalaId, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(tbSalaAforo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(tbSalaNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(tbSalaZoo, javax.swing.GroupLayout.DEFAULT_SIZE, 125, Short.MAX_VALUE))
                .addGap(33, 33, 33)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(bSalaModificar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bSalaAnyadir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bSalaBorrar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(91, 91, 91))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap(224, Short.MAX_VALUE)
                .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(129, 129, 129))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(jLabel26)
                .addGap(69, 69, 69)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(bSalaAnyadir)
                        .addGap(18, 18, 18)
                        .addComponent(bSalaModificar)
                        .addGap(18, 18, 18)
                        .addComponent(bSalaBorrar))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(2, 2, 2)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbSalaId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel27))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbSalaNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel28))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbSalaAforo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel29))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbSalaZoo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel30))))
                .addContainerGap(112, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Sala", jPanel5);

        bIrConsultas.setText("Ir a Consultas");
        bIrConsultas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bIrConsultasActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(bIrConsultas, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 579, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 385, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(bIrConsultas)
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * Método que cambia de la vista de la Gestion de las Tablas a la
     * Gestion de las consultas.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bIrConsultasActionPerformed(ActionEvent evt) {
        new Consultas().setVisible(true);
        this.setVisible(false);
    }

    /**
     * Método que añade un animal a la base de datos según los datos rellenos
     * en los textboxes de la interfaz.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bAnimalAnyadirActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bAnimalAnyadirActionPerformed
        if (checkClaveAnimal()) {
            if (tbAnimalExtincion.getSelectedItem().toString()
                    .compareTo("---") == 0 ||
                    tbAnimalPais.getText().compareTo("") == 0 ||
                    tbAnimalSala.getText().compareTo("") == 0 ||
                    tbAnimalEdad.getText().compareTo("") == 0 ||
                    tbAnimalEnfermedad.getSelectedItem().toString()
                    .compareTo("---") == 0 ||
                    tbAnimalDescripcion.getText().compareTo("") == 0) {
                JOptionPane.showMessageDialog(this, "No se ha rellenado " +
                        "información necesaria del animal. Por favor, " +
                        "rellene los campos que se indican en rojo.", "Error",
                        JOptionPane.ERROR_MESSAGE);
                if (tbAnimalExtincion.getSelectedItem().toString()
                        .compareTo("---") == 0) {
                    tbAnimalExtincion.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbAnimalExtincion.setBackground(new java.awt.Color(255,
                            255, 255));
                }
                if (tbAnimalPais.getText().compareTo("") == 0) {
                    tbAnimalPais.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbAnimalPais.setBackground(new java.awt.Color(255,
                            255, 255));
                }
                if (tbAnimalSala.getText().compareTo("") == 0) {
                    tbAnimalSala.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbAnimalSala.setBackground(new java.awt.Color(255,
                            255, 255));
                }
                if (tbAnimalEdad.getText().compareTo("") == 0) {
                    tbAnimalEdad.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbAnimalEdad.setBackground(new java.awt.Color(255,
                            255, 255));
                }
                if (tbAnimalEnfermedad.getSelectedItem().toString()
                        .compareTo("---") == 0) {
                    tbAnimalEnfermedad.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbAnimalEnfermedad.setBackground(new java.awt.Color(255,
                            255, 255));
                }
                if (tbAnimalDescripcion.getText().compareTo("") == 0) {
                    tbAnimalDescripcion.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbAnimalDescripcion.setBackground(new java.awt.Color(255,
                            255, 255));
                }
            } else {
                try {
                    Animal animal = new Animal(tbAnimalNombre.getText().toUpperCase(),
                            tbAnimalEspecie.getText().toUpperCase(),
                            new Integer(tbAnimalEdad.getText().toUpperCase()),
                            tbAnimalDescripcion.getText().toUpperCase(),
                            tbAnimalSala.getText().toUpperCase(),
                            tbAnimalPais.getText().toUpperCase(),
                            tbAnimalExtincion.getSelectedItem().toString().toUpperCase(),
                            tbAnimalEnfermedad.getSelectedItem().toString().toUpperCase());
                    try {
                        animal.insertarAnimal();
                        removeDatosAnimal();
                    } catch(ZooException e){
                        removeDatosAnimal();
                        JOptionPane.showMessageDialog(this, e.getMessage(),
                            "Error", JOptionPane.ERROR_MESSAGE);
                    }catch (Exception e) {
                        removeDatosAnimal();
                        JOptionPane.showMessageDialog(this, "Error en la " +
                                "inserción del animal.\n El animal ya existe.",
                                "Error", JOptionPane.ERROR_MESSAGE);
                    }
                } catch (NumberFormatException e) {
                    JOptionPane.showMessageDialog(this, "La edad no " +
                            "es un número. Por favor escriba " +
                            "sólo caracteres numéricos para este valor",
                            "Error", JOptionPane.ERROR_MESSAGE);
                } catch (ZooException e) {
                    JOptionPane.showMessageDialog(this, e.getMessage(), "Error",
                            JOptionPane.ERROR_MESSAGE);
                } catch (Exception e) {
                    JOptionPane.showMessageDialog(this, "Ha ocurrido un error " +
                            "desconocido en la inserción del animal.\n" +
                            "Por favor, intentelo de nuevo más tarde.",
                            "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }//GEN-LAST:event_bAnimalAnyadirActionPerformed

    /**
     * Método que modifica el animal en la base de datos definido por los
     * textboxes clave según el resto de los datos añadidos en los
     * textboxes de la interfaz.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bAnimalModificarActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bAnimalModificarActionPerformed
        if (checkClaveAnimal()) {
            try {
                GestorAnimal ganimal = new GestorAnimal();

                Animal a = ganimal.getAnimalbyId(tbAnimalNombre.getText(),
                        tbAnimalEspecie.getText());
                if (a != null) {
                    if (tbAnimalExtincion.getSelectedItem().toString()
                            .compareTo("---") != 0) {
                        a.setExtincion(tbAnimalExtincion.getSelectedItem()
                                .toString());
                    }
                    if (tbAnimalPais.getText().compareTo("") != 0) {
                        a.setPais(tbAnimalPais.getText());
                    }
                    if (tbAnimalSala.getText().compareTo("") != 0) {
                        a.setSala(tbAnimalSala.getText());
                    }
                    if (tbAnimalEdad.getText().compareTo("") != 0) {
                        try {
                            Integer edad = new Integer(tbAnimalEdad.getText());
                            a.setEdad(edad);
                        } catch (Exception e) {
                            JOptionPane.showMessageDialog(this, "La edad no " +
                                    "es un número. Por favor escriba " +
                                    "sólo caracteres numéricos para este valor",
                                    "Error", JOptionPane.ERROR_MESSAGE);
                        }
                    }
                    if (tbAnimalEnfermedad.getSelectedItem().toString()
                            .compareTo("---") != 0) {
                        a.setEnfermedad(tbAnimalEnfermedad.getSelectedItem()
                                .toString());
                    }
                    if (tbAnimalDescripcion.getText().compareTo("") != 0) {
                        a.setDescripcion(tbAnimalDescripcion.getText());
                    }
                    try {
                        a.borrarAnimal();
                        a.insertarAnimal();
                    } catch(ZooException e){
                        JOptionPane.showMessageDialog(this, e.getMessage(),
                            "Error", JOptionPane.ERROR_MESSAGE);
                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(this, "Ha habido un " +
                                "problema de conexión con la base de datos.\n "+
                                "Por favor, intentelo de nuevo más tarde",
                                "Error", JOptionPane.ERROR_MESSAGE);
                    }
                    removeDatosAnimal();
                } else {
                    JOptionPane.showMessageDialog(this, "El identificador " +
                            "de animal proporcionado no existe", "Error",
                            JOptionPane.ERROR_MESSAGE);
                }
            }catch(ZooException e){
                JOptionPane.showMessageDialog(this, e.getMessage(),
                    "Error", JOptionPane.ERROR_MESSAGE);
            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, "Ha habido un problema " +
                        "de conexión con la base de datos.\n Por favor," +
                        "intentelo de nuevo más tarde", "Error",
                        JOptionPane.ERROR_MESSAGE);
            }
        }
    }//GEN-LAST:event_bAnimalModificarActionPerformed

    /**
     * Método que bora un animal definido por los datos rellenos en la interfaz
     * pertenecientes a la clave.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bAnimalBorrarActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bAnimalBorrarActionPerformed
        if (checkClaveAnimal()) {
            try {
                GestorAnimal ganimal = new GestorAnimal();
                Animal animal = ganimal.getAnimalbyId(tbAnimalNombre.getText().toUpperCase(),
                        tbAnimalEspecie.getText().toUpperCase());
                if (animal != null) {
                    try {
                        animal.borrarAnimal();
                    }catch(ZooException e){
                        JOptionPane.showMessageDialog(this, e.getMessage(),
                            "Error", JOptionPane.ERROR_MESSAGE);
                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(this, "No se ha " +
                                "encontrado el animal cuya clave se ha " +
                                "escrito.\nPor favor, escriba unos valores " +
                                "correctos", "Error",
                                JOptionPane.ERROR_MESSAGE);
                    }
                    removeDatosAnimal();
                    JOptionPane.showMessageDialog(this, "El animal ha sido " +
                            "borrado", "Borrado finalizado con éxito",
                            JOptionPane.WARNING_MESSAGE);
                } else {
                    JOptionPane.showMessageDialog(this, "No se ha encontrado " +
                            "el animal cuya clave se ha escrito.\nPor favor, " +
                            "escriba unos valores correctos", "Error",
                            JOptionPane.ERROR_MESSAGE);
                    removeDatosAnimal();
                }
            }catch(ZooException e){
                JOptionPane.showMessageDialog(this, e.getMessage(),
                    "Error", JOptionPane.ERROR_MESSAGE);
            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, "Ha habido un problema " +
                        "de conexión con la base de datos.\n Por favor," +
                        "intentelo de nuevo más tarde", "Error",
                        JOptionPane.ERROR_MESSAGE);
            }
        }
    }//GEN-LAST:event_bAnimalBorrarActionPerformed

    /**
     * Método que añade un zoo a la base de datos según los datos rellenos
     * en los textboxes de la interfaz.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bZooAnyadirActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bZooAnyadirActionPerformed
        java.awt.Color blanco = new java.awt.Color(255, 255, 255);
        java.awt.Color rojo = new java.awt.Color(255, 102, 102);
        if (checkClaveZoo()) {
            if (tbZooNombre.getText().compareTo("") == 0 ||
                    tbZooCiudad.getText().compareTo("") == 0 ||
                    tbZooAforo.getText().compareTo("") == 0 ||
                    tbZooPais.getText().compareTo("") == 0 ||
                    tbZooIdioma.getText().compareTo("") == 0 ||
                    tbZooEntradas.getText().compareTo("") == 0) {
                JOptionPane.showMessageDialog(this, "No se ha rellenado " +
                        "información necesaria del zoo. Por favor, " +
                        "rellene los campos que se indican en rojo.", "Error",
                        JOptionPane.ERROR_MESSAGE);
                if (tbZooNombre.getText().compareTo("") == 0) {
                    tbZooNombre.setBackground(rojo);
                } else {
                    tbZooNombre.setBackground(blanco);
                }
                if (tbZooCiudad.getText().compareTo("") == 0) {
                    tbZooCiudad.setBackground(rojo);
                } else {
                    tbZooCiudad.setBackground(blanco);
                }
                if (tbZooAforo.getText().compareTo("") == 0) {
                    tbZooAforo.setBackground(rojo);
                } else {
                    tbZooAforo.setBackground(blanco);
                }
                if (tbZooPais.getText().compareTo("") == 0) {
                    tbZooPais.setBackground(rojo);
                } else {
                    tbZooPais.setBackground(blanco);
                }
                if (tbZooIdioma.getText().compareTo("") == 0) {
                    tbZooIdioma.setBackground(rojo);
                } else {
                    tbZooIdioma.setBackground(blanco);
                }
                if (tbZooEntradas.getText().compareTo("") == 0) {
                    tbZooEntradas.setBackground(rojo);
                } else {
                    tbZooEntradas.setBackground(blanco);
                }
            } else {
                try {
                    Zoo zoo = new Zoo(tbIdZoo.getText().toUpperCase(),
                            tbZooNombre.getText().toUpperCase(),
                            tbZooCiudad.getText().toUpperCase(),
                            new Integer(tbZooAforo.getText().toUpperCase()),
                            tbZooPais.getText().toUpperCase(),
                            tbZooIdioma.getText().toUpperCase(),
                            new Integer(tbZooEntradas.getText().toUpperCase()));
                    try {
                        zoo.insertarZoo();
                        removeDatosZoo();
                    }catch(ZooException e){
                        JOptionPane.showMessageDialog(this, e.getMessage(),
                            "Error", JOptionPane.ERROR_MESSAGE);
                    } catch (Exception e) {
                        removeDatosZoo();
                        JOptionPane.showMessageDialog(this, "Error en la " +
                                "inserción del zoo.\n El zoo ya existe.",
                                "Error", JOptionPane.ERROR_MESSAGE);
                    }
                } catch (NumberFormatException e) {
                    JOptionPane.showMessageDialog(this, "El aforo o el número " +
                            "de entradas vendidas no " +
                            "es un número. Por favor escriba " +
                            "sólo caracteres numéricos para este valor",
                            "Error", JOptionPane.ERROR_MESSAGE);
                } catch (ZooException e) {
                    JOptionPane.showMessageDialog(this, e.getMessage(), "Error",
                            JOptionPane.ERROR_MESSAGE);
                } catch (Exception e) {
                    JOptionPane.showMessageDialog(this, "Ha ocurrido un error " +
                            "desconocido en la inserción del zoo.\n" +
                            "Por favor, intentelo de nuevo más tarde.",
                            "Error", JOptionPane.ERROR_MESSAGE);
                }

            }
        }
    }//GEN-LAST:event_bZooAnyadirActionPerformed

    /**
     * Método que modifica la modificación en la base de datos definido por los
     * textboxes clave según el resto de los datos añadidos en los
     * textboxes de la interfaz.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bZooModificarActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bZooModificarActionPerformed
        if (checkClaveZoo()) {
            try {
                GestorZoo gzoo = new GestorZoo();
                Zoo z = gzoo.getZoobyId(tbIdZoo.getText().toUpperCase());
                if (z != null) {
                    if (tbZooNombre.getText().compareTo("") != 0) {
                        z.setNombre(tbZooNombre.getText().toUpperCase());
                    }
                    if (tbZooCiudad.getText().compareTo("") != 0) {
                        z.setCiudad(tbZooCiudad.getText().toUpperCase());
                    }
                    if (tbZooAforo.getText().compareTo("") != 0) {
                        try {
                            Integer aforo = new Integer(tbZooAforo.getText().toUpperCase());
                            z.setAforo(aforo);
                        } catch (Exception e) {
                            JOptionPane.showMessageDialog(this, "El aforo " +
                                    "escrito no es un número. Por favor " +
                                    "escriba sólo caracteres numéricos",
                                    "Error", JOptionPane.ERROR_MESSAGE);
                        }
                    }
                    if (tbZooPais.getText().compareTo("") != 0) {
                        z.setPais(tbZooPais.getText().toUpperCase());
                    }
                    if (tbZooIdioma.getText().compareTo("") != 0) {
                        z.setIdioma(tbZooIdioma.getText().toUpperCase());
                    }
                    if (tbZooEntradas.getText().compareTo("") != 0) {
                        try {
                            Integer aforo = new Integer(
                                    tbZooEntradas.getText().toUpperCase());
                            z.setEntradas(aforo);
                        } catch (Exception e) {
                            JOptionPane.showMessageDialog(this, "El numero " +
                                    "de entradas vendidas " +
                                    "escrito no es un número. Por favor " +
                                    "escriba sólo caracteres numéricos",
                                    "Error", JOptionPane.ERROR_MESSAGE);
                        }
                    }
                    try {
                        z.borrarZoo();
                        z.insertarZoo();
                    }catch(ZooException e){
                        JOptionPane.showMessageDialog(this, e.getMessage(),
                            "Error", JOptionPane.ERROR_MESSAGE);
                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(this, "Ha habido un " +
                                "problema de conexión con la base de datos." +
                                "\nPor favor, intentelo de nuevo más tarde",
                                "Error", JOptionPane.ERROR_MESSAGE);
                    }
                    removeDatosZoo();
                } else {
                    JOptionPane.showMessageDialog(this, "El identificador " +
                            "de animal proporcionado no existe", "Error",
                            JOptionPane.ERROR_MESSAGE);
                }
            }catch(ZooException e){
                JOptionPane.showMessageDialog(this, e.getMessage(),
                    "Error", JOptionPane.ERROR_MESSAGE);
            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, "Ha habido un problema " +
                        "de conexión con la base de datos.\n Por favor," +
                        "intentelo de nuevo más tarde", "Error",
                        JOptionPane.ERROR_MESSAGE);
            }
        }
    }//GEN-LAST:event_bZooModificarActionPerformed

    /**
     * Método que bora un zoo definido por los datos rellenos en la interfaz
     * pertenecientes a la clave.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bZooBorrarActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bZooBorrarActionPerformed
        if (checkClaveZoo()) {
            try {
                GestorZoo z = new GestorZoo();
                Zoo zoo = z.getZoobyId(tbIdZoo.getText().toUpperCase());
                if (zoo != null) {
                    try {
                        zoo.borrarZoo();
                    }catch(ZooException e){
                        JOptionPane.showMessageDialog(this, e.getMessage(),
                            "Error", JOptionPane.ERROR_MESSAGE);
                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(this, "No se ha " +
                                "encontrado el zoo cuya clave se ha escrito." +
                                "\nPor favor, escriba unos valores correctos",
                                "Error", JOptionPane.ERROR_MESSAGE);
                    }
                    removeDatosZoo();
                    JOptionPane.showMessageDialog(this, "El zoo ha sido " +
                            "borrado", "Borrado finalizado con éxito",
                            JOptionPane.WARNING_MESSAGE);
                } else {
                    JOptionPane.showMessageDialog(this, "No se ha encontrado " +
                            "el zoo cuya clave se ha escrito.\nPor favor, " +
                            "escriba unos valores correctos", "Error",
                            JOptionPane.ERROR_MESSAGE);
                    removeDatosAnimal();
                }
            }catch(ZooException e){
                JOptionPane.showMessageDialog(this, e.getMessage(),
                    "Error", JOptionPane.ERROR_MESSAGE);
            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, "Ha habido un problema " +
                        "de conexión con la base de datos.\n Por favor," +
                        "intentelo de nuevo más tarde", "Error",
                        JOptionPane.ERROR_MESSAGE);
            }
        }
    }//GEN-LAST:event_bZooBorrarActionPerformed

    /**
     * Método que añade un empleado a la base de datos según los datos rellenos
     * en los textboxes de la interfaz.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bEmpleadoAnyadirActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bEmpleadoAnyadirActionPerformed
        if (checkClaveEmpleado()) {
            if (tbEmpleadoEdad.getText().compareTo("") == 0 ||
                    tbEmpleadoTelefono.getText().compareTo("") == 0 ||
                    tbEmpleadoApellido2.getText().compareTo("") == 0 ||
                    tbEmpleadoApellido1.getText().compareTo("") == 0 ||
                    tbEmpleadoEspecialidad.getSelectedItem().toString()
                    .compareTo("---") == 0 ||
                    tbEmpleadoEstado.getSelectedItem().toString()
                    .compareTo("---") == 0 ||
                    tbEmpleadoNombre.getText().compareTo("") == 0) {
                JOptionPane.showMessageDialog(this, "No se ha rellenado " +
                        "información necesaria del empleado. Por favor, " +
                        "rellene los campos que se indican en rojo.", "Error",
                        JOptionPane.ERROR_MESSAGE);
                if (tbEmpleadoEdad.getText().compareTo("") == 0) {
                    tbEmpleadoEdad.setBackground(new java.awt.Color(255, 102,
                            102));
                } else {
                    tbEmpleadoEdad.setBackground(new java.awt.Color(255, 255,
                            255));
                }
                if (tbEmpleadoTelefono.getText().compareTo("") == 0) {
                    tbEmpleadoTelefono.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbEmpleadoTelefono.setBackground(new java.awt.Color(255,
                            255, 255));
                }
                if (tbEmpleadoApellido2.getText().compareTo("") == 0) {
                    tbEmpleadoApellido2.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbEmpleadoApellido2.setBackground(new java.awt.Color(255,
                            255, 255));
                }
                if (tbEmpleadoApellido1.getText().compareTo("") == 0) {
                    tbEmpleadoApellido1.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbEmpleadoApellido1.setBackground(new java.awt.Color(255,
                            255, 255));
                }
                if (tbEmpleadoNombre.getText().compareTo("") == 0) {
                    tbEmpleadoNombre.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbEmpleadoNombre.setBackground(new java.awt.Color(255,
                            255, 255));
                }
                if (tbEmpleadoEspecialidad.getSelectedItem().toString()
                        .compareTo("---") == 0) {
                    tbEmpleadoEspecialidad.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbEmpleadoEspecialidad.setBackground(new java.awt.Color(255,
                            255, 255));
                }
                if (tbEmpleadoEstado.getSelectedItem().toString()
                        .compareTo("---") == 0) {
                    tbEmpleadoEstado.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbEmpleadoEstado.setBackground(new java.awt.Color(255,
                            255, 255));
                }
            } else {

                int telefono = 0;
                try {
                    telefono = new Integer(tbEmpleadoTelefono.getText().toUpperCase());
                    try {
                        Cuidador empleado = new Cuidador(tbEmpleadoId.getText().toUpperCase(),
                                tbEmpleadoNombre.getText().toUpperCase(),
                                tbEmpleadoApellido1.getText().toUpperCase(),
                                tbEmpleadoApellido2.getText().toUpperCase(),
                                telefono,
                                new Integer(tbEmpleadoEdad.getText().toUpperCase()),
                                tbEmpleadoEspecialidad.getSelectedItem()
                                .toString().toUpperCase(),
                                tbEmpleadoEstado.getSelectedItem().toString().toUpperCase());
                        try {
                            empleado.insertarCuidador();
                            removeDatosEmpleado();
                        } catch (Exception e) {
                            JOptionPane.showMessageDialog(this, "Error en la " +
                                    "inserción del cuidador.\n El cuidador " +
                                    "ya existe.",
                                    "Error", JOptionPane.ERROR_MESSAGE);
                            removeDatosEmpleado();
                        }
                    } catch (NumberFormatException e) {
                        JOptionPane.showMessageDialog(this, "La edad " +
                                " no es un número. Por favor escriba " +
                                "sólo caracteres numéricos para estos valores",
                                "Error", JOptionPane.ERROR_MESSAGE);
                    } catch (ZooException e) {
                        JOptionPane.showMessageDialog(this, e.getMessage(),
                                "Error", JOptionPane.ERROR_MESSAGE);
                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(this, "Ha ocurrido un " +
                                "error" +
                                "desconocido en la inserción del cuidador.\n" +
                                "Por favor, intentelo de nuevo más tarde.",
                                "Error", JOptionPane.ERROR_MESSAGE);
                    }
                } catch (Exception e) {
                    JOptionPane.showMessageDialog(this, "El teléfono " +
                            " introducido no es un número o tiene más de" +
                            " 9 dígitos. Por favor escriba el telefono " +
                            "en un formato correcto",
                            "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }//GEN-LAST:event_bEmpleadoAnyadirActionPerformed

    /**
     * Método que modifica el empleado en la base de datos definido por los
     * textboxes clave según el resto de los datos añadidos en los
     * textboxes de la interfaz.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bEmpleadoModificarActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bEmpleadoModificarActionPerformed
        if (checkClaveEmpleado()) {
            try {
                GestorCuidador gcuidador = new GestorCuidador();
                Cuidador c = gcuidador.getCuidadorbyId(tbEmpleadoId.getText().toUpperCase());

                if (c != null) {
                    if (tbEmpleadoEdad.getText().compareTo("") != 0) {
                        try {
                            Integer edad =
                                    new Integer(tbEmpleadoEdad.getText().toUpperCase());
                            c.setEdad(edad);
                        } catch (Exception e) {
                            JOptionPane.showMessageDialog(this, "La edad no " +
                                    "es un número. Por favor escriba " +
                                    "sólo caracteres numéricos para este valor",
                                    "Error", JOptionPane.ERROR_MESSAGE);
                        }
                    }
                    if (tbEmpleadoTelefono.getText().compareTo("") != 0) {
                        try {
                            Integer tlf = new Integer(tbEmpleadoEdad.getText().toUpperCase());
                            c.setTelefono(tlf);
                        } catch (Exception e) {
                            JOptionPane.showMessageDialog(this, "El teléfono" +
                                    " no es un número. Por favor escriba " +
                                    "sólo caracteres numéricos para este valor",
                                    "Error", JOptionPane.ERROR_MESSAGE);
                        }
                    }
                    if (tbEmpleadoApellido2.getText().compareTo("") != 0) {
                        c.setApellido2(tbEmpleadoApellido2.getText().toUpperCase());
                    }
                    if (tbEmpleadoApellido1.getText().compareTo("") != 0) {
                        c.setApellido1(tbEmpleadoApellido1.getText().toUpperCase());
                    }
                    if (tbEmpleadoEspecialidad.getSelectedItem().toString()
                            .compareTo("---") != 0) {
                        c.setEspecialidad(tbEmpleadoEspecialidad
                                .getSelectedItem().toString().toUpperCase());
                    }
                    if (tbEmpleadoEstado.getSelectedItem().toString()
                            .compareTo("---") != 0) {
                        c.setEstado(tbEmpleadoEstado
                                .getSelectedItem().toString().toUpperCase());
                    }
                    if (tbEmpleadoNombre.getText().compareTo("") != 0) {
                        c.setNombre(tbEmpleadoNombre.getText().toUpperCase());
                    }
                    try {
                        c.borrarCuidador();
                        c.insertarCuidador();
                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(this, "Ha habido un " +
                                "problema de conexión con la base de datos." +
                                "\n Por favor, intentelo de nuevo más tarde",
                                "Error", JOptionPane.ERROR_MESSAGE);
                    }
                    removeDatosEmpleado();
                } else {
                    JOptionPane.showMessageDialog(this, "El identificador " +
                            "de cuidador proporcionado no existe", "Error",
                            JOptionPane.ERROR_MESSAGE);
                }
            } catch (NumberFormatException e) {
                JOptionPane.showMessageDialog(this, "El aforo " +
                        "no es un número. Por favor escriba " +
                        "sólo caracteres numéricos para estos valores",
                        "Error", JOptionPane.ERROR_MESSAGE);
            }catch(ZooException e){
                JOptionPane.showMessageDialog(this, e.getMessage(),
                    "Error", JOptionPane.ERROR_MESSAGE);
            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, "Ha habido un problema " +
                        "de conexión con la base de datos.\n Por favor," +
                        "intentelo de nuevo más tarde", "Error",
                        JOptionPane.ERROR_MESSAGE);
            }
        }
    }//GEN-LAST:event_bEmpleadoModificarActionPerformed

    /**
     * Método que bora un empleado definido por los datos rellenos en la
     * interfaz pertenecientes a la clave.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bEmpleadoBorrarActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bEmpleadoBorrarActionPerformed
        if (checkClaveEmpleado()) {
            try {
                GestorCuidador gempleado = new GestorCuidador();
                Cuidador empleado =
                        gempleado.getCuidadorbyId(tbEmpleadoId.getText().toUpperCase());
                if (empleado != null) {
                    try {
                        empleado.borrarCuidador();
                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(this, "No se ha " +
                                "encontrado el empleado cuya clave se ha " +
                                "escrito.\nPor favor, escriba unos valores" +
                                " correctos", "Error",
                                JOptionPane.ERROR_MESSAGE);
                    }
                    removeDatosEmpleado();
                    JOptionPane.showMessageDialog(this, "El empleado ha " +
                            "sido borrado", "Borrado finalizado con éxito",
                            JOptionPane.WARNING_MESSAGE);
                } else {
                    JOptionPane.showMessageDialog(this, "No se ha encontrado " +
                            "el empleado cuya clave se ha escrito.\nPor favor" +
                            ", escriba unos valores correctos", "Error",
                            JOptionPane.ERROR_MESSAGE);
                    removeDatosEmpleado();
                }
            }catch(ZooException e){
                JOptionPane.showMessageDialog(this, e.getMessage(),
                    "Error", JOptionPane.ERROR_MESSAGE);
            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, "Ha habido un problema " +
                        "de conexión con la base de datos.\n Por favor," +
                        "intentelo de nuevo más tarde", "Error",
                        JOptionPane.ERROR_MESSAGE);
            }
        }
    }//GEN-LAST:event_bEmpleadoBorrarActionPerformed

    /**
     * Método que añade una sala a la base de datos según los datos rellenos
     * en los textboxes de la interfaz.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bSalaAnyadirActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bSalaAnyadirActionPerformed
        if (checkClaveSala()) {
            if (tbSalaZoo.getText().compareTo("") == 0 ||
                    tbSalaAforo.getText().compareTo("") == 0 ||
                    tbSalaNombre.getText().compareTo("") == 0) {
                JOptionPane.showMessageDialog(this, "No se ha rellenado " +
                        "información necesaria de la sala. Por favor, " +
                        "rellene los campos que se indican en rojo.", "Error",
                        JOptionPane.ERROR_MESSAGE);
                if (tbSalaZoo.getText().compareTo("") == 0) {
                    tbSalaZoo.setBackground(new java.awt.Color(255, 102, 102));
                } else {
                    tbSalaZoo.setBackground(new java.awt.Color(255, 255, 255));
                }
                if (tbSalaAforo.getText().compareTo("") == 0) {
                    tbSalaAforo.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbSalaAforo.setBackground(new java.awt.Color(255,
                            255, 255));
                }
                if (tbSalaNombre.getText().compareTo("") == 0) {
                    tbSalaNombre.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbSalaNombre.setBackground(new java.awt.Color(255,
                            255, 255));
                }
            } else {
                try {
                    Sala sala = new Sala(tbSalaId.getText().toUpperCase(),
                            new Integer(tbSalaAforo.getText().toUpperCase()),
                            tbSalaNombre.getText().toUpperCase(),
                            tbSalaZoo.getText().toUpperCase());
                    try {
                        sala.insertarSala();
                        removeDatosSala();
                    } catch (Exception e) {
                        removeDatosSala();
                        JOptionPane.showMessageDialog(this, "Error en la " +
                                "inserción de la sala.\n La sala ya existe.",
                                "Error", JOptionPane.ERROR_MESSAGE);
                    }
                } catch (ZooException e) {
                    JOptionPane.showMessageDialog(this, e.getMessage(), "Error",
                            JOptionPane.ERROR_MESSAGE);
                } catch (NumberFormatException e) {
                    JOptionPane.showMessageDialog(this, "El aforo no " +
                            "es un número. Por favor escriba " +
                            "sólo caracteres numéricos para este valor",
                            "Error", JOptionPane.ERROR_MESSAGE);
                } catch (Exception e) {
                    JOptionPane.showMessageDialog(this, "Ha ocurrido un error" +
                            "desconocido en la inserción de la sala.\n" +
                            "Por favor, intentelo de nuevo más tarde.",
                            "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }//GEN-LAST:event_bSalaAnyadirActionPerformed

    /**
     * Método que modifica la sala en la base de datos definido por los
     * textboxes clave según el resto de los datos añadidos en los
     * textboxes de la interfaz.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bSalaModificarActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bSalaModificarActionPerformed
        if (checkClaveSala()) {
            try {
                GestorSala gsala = new GestorSala();
                Sala s = gsala.getSalabyId(tbSalaId.getText().toUpperCase());

                if (s != null) {
                    if (tbSalaZoo.getText().compareTo("") != 0) {
                        s.setZoo(tbSalaZoo.getText().toUpperCase());
                    }
                    if (tbSalaAforo.getText().compareTo("") != 0) {
                        try {
                            Integer aforo = new Integer(tbSalaAforo.getText());
                            s.setAforoSala(aforo);
                        } catch (Exception e) {
                            JOptionPane.showMessageDialog(this, "El aforo no " +
                                    "es un número. Por favor escriba " +
                                    "sólo caracteres numéricos para este valor",
                                    "Error", JOptionPane.ERROR_MESSAGE);
                        }
                    }
                    if (tbSalaNombre.getText().compareTo("") != 0) {
                        s.setNombre(tbSalaNombre.getText().toUpperCase());
                    }
                    try {
                        s.borrarSala();
                        s.insertarSala();
                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(this, "Ha habido un " +
                                "problema de conexión con la base de datos." +
                                "\nPor favor, intentelo de nuevo más tarde",
                                "Error", JOptionPane.ERROR_MESSAGE);
                    }
                    removeDatosSala();
                } else {
                    JOptionPane.showMessageDialog(this, "El identificador " +
                            "de sala proporcionado no existe", "Error",
                            JOptionPane.ERROR_MESSAGE);
                }
            }catch(ZooException e){
                JOptionPane.showMessageDialog(this, e.getMessage(),
                    "Error", JOptionPane.ERROR_MESSAGE);
            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, "Ha habido un problema " +
                        "de conexión con la base de datos.\n Por favor," +
                        "intentelo de nuevo más tarde", "Error",
                        JOptionPane.ERROR_MESSAGE);
            }
        }
    }//GEN-LAST:event_bSalaModificarActionPerformed

    /**
     * Método que bora una sala definida por los datos rellenos en la interfaz
     * pertenecientes a la clave.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bSalaBorrarActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bSalaBorrarActionPerformed
        if (checkClaveSala()) {
            try {
                GestorSala gsala = new GestorSala();
                Sala sala = gsala.getSalabyId(tbSalaId.getText().toUpperCase());
                if (sala != null) {
                    try {
                        sala.borrarSala();
                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(this, "No se ha " +
                                "encontrado la sala cuya clave se ha escrito." +
                                "\nPor favor, escriba unos valores correctos",
                                "Error", JOptionPane.ERROR_MESSAGE);
                    }
                    removeDatosSala();
                    JOptionPane.showMessageDialog(this, "La sala ha sido " +
                            "borrado", "Borrado finalizado con éxito",
                            JOptionPane.WARNING_MESSAGE);
                } else {
                    JOptionPane.showMessageDialog(this, "No se ha encontrado " +
                            "la sala cuya clave se ha escrito.\nPor favor, " +
                            "escriba unos valores correctos", "Error",
                            JOptionPane.ERROR_MESSAGE);
                    removeDatosAnimal();
                }
            }catch(ZooException e){
                JOptionPane.showMessageDialog(this, e.getMessage(),
                    "Error", JOptionPane.ERROR_MESSAGE);
            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, "Ha habido un problema " +
                        "de conexión con la base de datos.\n Por favor," +
                        "intentelo de nuevo más tarde", "Error",
                        JOptionPane.ERROR_MESSAGE);
            }
        }
    }//GEN-LAST:event_bSalaBorrarActionPerformed

    /**
     * Método que añade un ticket a la base de datos según los datos rellenos
     * en los textboxes de la interfaz.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bTicketAnyadirActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bTicketAnyadirActionPerformed
        if (checkClaveTicket()) {
            if (tbTicketPrecio.getText().compareTo("") == 0) {
                JOptionPane.showMessageDialog(this, "No se ha rellenado " +
                        "información necesaria del ticket. Por favor, " +
                        "rellene los campos que se indican en rojo.", "Error",
                        JOptionPane.ERROR_MESSAGE);
                if (tbTicketPrecio.getText().compareTo("") == 0) {
                    tbTicketPrecio.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbTicketPrecio.setBackground(new java.awt.Color(255,
                            255, 255));
                }
            } else {
                try {
                    Ticket ticket = new Ticket(tbTicketZoo.getText().toUpperCase(),
                            tbTicketTipo.getSelectedItem().toString().toUpperCase(),
                            new Double(tbTicketPrecio.getText().toUpperCase()));

                    try {
                        ticket.insertarTickets();
                        removeDatosTicket();
                    } catch (Exception e) {
                        removeDatosAnimal();
                        JOptionPane.showMessageDialog(this, "Error en la " +
                                "inserción del ticket.\n El ticket ya existe.",
                                "Error", JOptionPane.ERROR_MESSAGE);
                    }
                } catch (NumberFormatException e) {
                    JOptionPane.showMessageDialog(this, "El precio no " +
                            "es un número. Por favor escriba " +
                            "sólo caracteres numéricos para este valor",
                            "Error", JOptionPane.ERROR_MESSAGE);
                } catch (ZooException e) {
                    JOptionPane.showMessageDialog(this, e.getMessage(), "Error",
                            JOptionPane.ERROR_MESSAGE);
                } catch (Exception e) {
                    JOptionPane.showMessageDialog(this, "Ha ocurrido un error" +
                            "desconocido en la inserción del ticket.\n" +
                            "Por favor, intentelo de nuevo más tarde.",
                            "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }//GEN-LAST:event_bTicketAnyadirActionPerformed

    /**
     * Método que modifica el ticket en la base de datos definido por los
     * textboxes clave según el resto de los datos añadidos en los
     * textboxes de la interfaz.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bTicketModificarActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bTicketModificarActionPerformed
        if (checkClaveTicket()) {
            try {
                GestorTickets gticket = new GestorTickets();
                Ticket t = gticket.getTicketbyId(tbTicketZoo.getText().toUpperCase(),
                        tbTicketTipo.getSelectedItem().toString().toUpperCase());
                if (t != null) {
                    if (tbTicketPrecio.getText().compareTo("") != 0) {
                        try {
                            Integer precio =
                                    new Integer(tbTicketPrecio.getText().toUpperCase());
                            t.setPrecio(precio);
                        } catch (Exception e) {
                            JOptionPane.showMessageDialog(this, "La edad no " +
                                    "es un número. Por favor escriba " +
                                    "sólo caracteres numéricos para este valor",
                                    "Error", JOptionPane.ERROR_MESSAGE);
                        }
                    }
                    try {
                        t.borrarTickets();
                        t.insertarTickets();
                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(this, "Ha habido un " +
                                "problema de conexión con la base de datos." +
                                "\nPor favor, intentelo de nuevo más tarde",
                                "Error", JOptionPane.ERROR_MESSAGE);
                    }
                    removeDatosTicket();
                } else {
                    JOptionPane.showMessageDialog(this, "El identificador " +
                            "de ticket proporcionado no existe", "Error",
                            JOptionPane.ERROR_MESSAGE);
                }
            }catch(ZooException e){
                JOptionPane.showMessageDialog(this, e.getMessage(),
                    "Error", JOptionPane.ERROR_MESSAGE);
            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, "Ha habido un problema " +
                        "de conexión con la base de datos.\n Por favor," +
                        "intentelo de nuevo más tarde", "Error",
                        JOptionPane.ERROR_MESSAGE);
            }
        }
    }//GEN-LAST:event_bTicketModificarActionPerformed

    /**
     * Método que bora un ticket definido por los datos rellenos en la interfaz
     * pertenecientes a la clave.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bTicketBorrarActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bTicketBorrarActionPerformed
        if (checkClaveTicket()) {
            try {
                GestorTickets gticket = new GestorTickets();
                Ticket ticket = gticket.getTicketbyId(tbTicketZoo.getText().toUpperCase(),
                        tbTicketTipo.getSelectedItem().toString().toUpperCase());
                if (ticket != null) {
                    try {
                        ticket.borrarTickets();
                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(this, "No se ha " +
                                "encontrado el ticket cuya clave se ha " +
                                "escrito.\nPor favor, escriba unos valores " +
                                "correctos", "Error",
                                JOptionPane.ERROR_MESSAGE);
                    }
                    removeDatosTicket();
                    JOptionPane.showMessageDialog(this, "El ticket ha sido " +
                            "borrado", "Borrado finalizado con éxito",
                            JOptionPane.WARNING_MESSAGE);
                } else {
                    JOptionPane.showMessageDialog(this, "No se ha encontrado" +
                            " el ticket cuya clave se ha escrito.\n" +
                            "Por favor, escriba unos valores correctos",
                            "Error", JOptionPane.ERROR_MESSAGE);
                    removeDatosAnimal();
                }
            }catch(ZooException e){
                JOptionPane.showMessageDialog(this, e.getMessage(),
                    "Error", JOptionPane.ERROR_MESSAGE);
            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, "Ha habido un problema " +
                        "de conexión con la base de datos.\n Por favor," +
                        "intentelo de nuevo más tarde", "Error",
                        JOptionPane.ERROR_MESSAGE);
            }
        }
    }//GEN-LAST:event_bTicketBorrarActionPerformed

    /**
     * Método que añade un horario a la base de datos según los datos rellenos
     * en los textboxes de la interfaz.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bHorarioAnyadirActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bHorarioAnyadirActionPerformed
        if (checkClaveHorario()) {
            if (tbHorarioTipoComida.getSelectedItem().toString()
                    .compareTo("---") == 0) {
                JOptionPane.showMessageDialog(this, "No se ha rellenado " +
                        "información necesaria del horario. Por favor, " +
                        "rellene los campos que se indican en rojo.", "Error",
                        JOptionPane.ERROR_MESSAGE);
                if (tbHorarioTipoComida.getSelectedItem().toString()
                        .compareTo("---") == 0) {
                    tbHorarioTipoComida.setBackground(new java.awt.Color(255,
                            102, 102));
                } else {
                    tbHorarioTipoComida.setBackground(new java.awt.Color(255,
                            255, 255));
                }
            } else {
                if(tbHorarioHora.getText().length() == 5 &&
                        tbHorarioHora.getText().indexOf(":") == 2){
                    try {
                        Horario horario = new Horario(tbHorarioHora.getText().toUpperCase(),
                                tbHorarioTipoComida.getSelectedItem().toString().toUpperCase(),
                                tbHorarioAnimal.getText().toUpperCase(),
                                tbHorarioEspecie.getText().toUpperCase());
                        try {
                            horario.insertarHorario();
                            removeDatosHorario();
                        } catch (Exception e) {
                            removeDatosHorario();
                            JOptionPane.showMessageDialog(this, "Error en la " +
                                    "inserción del horario.\nEl horario ya " +
                                    "existe.",
                                    "Error", JOptionPane.ERROR_MESSAGE);
                        }
                    } catch (ZooException e) {
                        JOptionPane.showMessageDialog(this, e.getMessage(),
                                "Error", JOptionPane.ERROR_MESSAGE);
                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(this, "Ha ocurrido un " +
                                "error" +
                                "desconocido en la inserción del horario.\n" +
                                "Por favor, intentelo de nuevo más tarde.",
                                "Error", JOptionPane.ERROR_MESSAGE);
                    }
                }else{
                    JOptionPane.showMessageDialog(this, "La hora tiene que " +
                            "tener un formato HH:MM",
                            "Error de formato", JOptionPane.WARNING_MESSAGE);
                }
            }
        }
    }//GEN-LAST:event_bHorarioAnyadirActionPerformed

    /**
     * Método que modifica el horario en la base de datos definido por los
     * textboxes clave según el resto de los datos añadidos en los
     * textboxes de la interfaz.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bHorarioModificarActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bHorarioModificarActionPerformed
        if (checkClaveHorario()) {
            if(tbHorarioHora.getText().length() == 5 &&
                        tbHorarioHora.getText().indexOf(":") == 2){
                try {
                    GestorHorario ghorario = new GestorHorario();

                    Horario h = ghorario.getHorariobyId(
                            tbHorarioHora.getText().toUpperCase(),
                            tbHorarioAnimal.getText().toUpperCase(),
                            tbHorarioEspecie.getText().toUpperCase());
                    if (h != null) {
                        if (tbHorarioTipoComida.getSelectedItem().toString()
                                .compareTo("---") != 0) {
                            h.setTipoComida(tbHorarioTipoComida.
                                    getSelectedItem().toString().toUpperCase());
                        }
                        try {
                            h.borrarHorario();
                            h.insertarHorario();
                        } catch (Exception e) {
                            JOptionPane.showMessageDialog(this, "Ha habido " +
                                    "un problema de conexión con la base de " +
                                    "datos.\n Por favor, intentelo de nuevo " +
                                    "más tarde",
                                    "Error", JOptionPane.ERROR_MESSAGE);
                        }
                        removeDatosHorario();
                    } else {
                        JOptionPane.showMessageDialog(this, "El identifica" +
                                "dor de animal proporcionado no existe",
                                "Error", JOptionPane.ERROR_MESSAGE);
                    }
                } catch (ZooException e) {
                    JOptionPane.showMessageDialog(this, e.getMessage(),
                        "Error", JOptionPane.ERROR_MESSAGE);
                } catch (Exception e) {
                    JOptionPane.showMessageDialog(this, "Ha habido un " +
                            "problema " +
                            "de conexión con la base de datos.\n Por favor," +
                            "intentelo de nuevo más tarde", "Error",
                            JOptionPane.ERROR_MESSAGE);
                }
            }else{
                JOptionPane.showMessageDialog(this, "La hora tiene que " +
                        "tener un formato HH:MM",
                        "Error de formato", JOptionPane.WARNING_MESSAGE);
            }
        }
    }//GEN-LAST:event_bHorarioModificarActionPerformed

    /**
     * Método que borra un horario definido por los datos rellenos en la
     * interfaz pertenecientes a la clave.
     *
     * @param evt Evento que hace que se ejecute el método.
     */
    private void bHorarioBorrarActionPerformed(ActionEvent evt) {//GEN-FIRST:event_bHorarioBorrarActionPerformed
        if (checkClaveHorario()) { 
            if(tbHorarioHora.getText().length() == 5 &&
                        tbHorarioHora.getText().indexOf(":") == 2){
                try {
                    GestorHorario ghorario = new GestorHorario();
                    Horario horario = ghorario.getHorariobyId(
                            tbHorarioHora.getText().toUpperCase(),
                            tbHorarioAnimal.getText().toUpperCase(),
                            tbHorarioEspecie.getText().toUpperCase());
                    if (horario != null) {
                        try {
                            horario.borrarHorario();
                        } catch (Exception e) {
                            JOptionPane.showMessageDialog(this, "No se ha " +
                                    "encontrado el horario cuya clave se ha " +
                                    "escrito.\nPor favor, escriba unos valores"+
                                    " correctos", "Error",
                                    JOptionPane.ERROR_MESSAGE);
                        }
                        removeDatosHorario();
                        JOptionPane.showMessageDialog(this, "El horario ha " +
                                "sido borrado", "Borrado finalizado con éxito",
                                JOptionPane.WARNING_MESSAGE);
                    } else {
                        JOptionPane.showMessageDialog(this, "No se ha " +
                                "encontrado el horario cuya clave se ha " +
                                "escrito.\nPor favor, escriba unos valores " +
                                "correctos", "Error",
                                JOptionPane.ERROR_MESSAGE);
                        removeDatosAnimal();
                    }
                } catch (ZooException e) {
                    JOptionPane.showMessageDialog(this, e.getMessage(),
                        "Error", JOptionPane.ERROR_MESSAGE);
                } catch (Exception e) {
                    JOptionPane.showMessageDialog(this, "Ha habido un proble" +
                            "ma de conexión con la base de datos.\n Por " +
                            "favor, intentelo de nuevo más tarde", "Error",
                            JOptionPane.ERROR_MESSAGE);
                }
            }else{
                    JOptionPane.showMessageDialog(this, "La hora tiene que " +
                            "tener un formato HH:MM",
                            "Error de formato", JOptionPane.WARNING_MESSAGE);
            }
        }
    }//GEN-LAST:event_bHorarioBorrarActionPerformed

    /**
     * Método que comprueba si los textbox correspondientes a la clave
     * del horario están rellenos.
     *
     * @return <true> Si la clave se he rellenado
     *          <false> Si la clave no se ha rellenado
     */
    private boolean checkClaveHorario() {
        if (tbHorarioAnimal.getText().compareTo("") == 0 ||
                tbHorarioHora.getText().compareTo("") == 0 ||
                tbHorarioEspecie.getText().compareTo("") == 0) {
            JOptionPane.showMessageDialog(this, "No se ha rellenado la infor" +
                    "mación identificativa del horario. Por favor, " +
                    "rellene los campos que se indican en rojo.", "Error",
                    JOptionPane.ERROR_MESSAGE);
            paintHorario();
            return false;
        }
        paintHorario();
        return true;
    }

    /**
     * Método que comprueba si los textbox correspondientes a la clave
     * del ticket están rellenos.
     *
     * @return <true> Si la clave se he rellenado
     *          <false> Si la clave no se ha rellenado
     */
    private boolean checkClaveTicket() {
        if (tbTicketZoo.getText().compareTo("") == 0 ||
                tbTicketTipo.getSelectedItem().toString()
                .compareTo("---") == 0) {
            JOptionPane.showMessageDialog(this, "No se ha rellenado la infor" +
                    "mación identificativa del ticket. Por favor, " +
                    "rellene los campos que se indican en rojo.", "Error",
                    JOptionPane.ERROR_MESSAGE);
            paintTicket();
            return false;
        }
        paintTicket();
        return true;
    }

    /**
     * Método que comprueba si los textbox correspondientes a la clave
     * de la sala están rellenos.
     *
     * @return <true> Si la clave se he rellenado
     *          <false> Si la clave no se ha rellenado
     */
    private boolean checkClaveSala() {
        if (tbSalaId.getText().compareTo("") == 0) {
            JOptionPane.showMessageDialog(this, "No se ha rellenado la infor" +
                    "mación identificativa de la sala. Por favor, " +
                    "rellene los campos que se indican en rojo.", "Error",
                    JOptionPane.ERROR_MESSAGE);
            paintSala();
            return false;
        }
        paintSala();
        return true;
    }

    /**
     * Método que comprueba si los textbox correspondientes a la clave
     * del empleado están rellenos.
     *
     * @return <true> Si la clave se he rellenado
     *          <false> Si la clave no se ha rellenado
     */
    private boolean checkClaveEmpleado() {
        if (tbEmpleadoId.getText().compareTo("") == 0) {
            JOptionPane.showMessageDialog(this, "No se ha rellenado la infor" +
                    "mación identificativa del empleado. Por favor, " +
                    "rellene los campos que se indican en rojo.", "Error",
                    JOptionPane.ERROR_MESSAGE);
            paintEmpleado();
            return false;
        }
        paintEmpleado();
        return true;
    }

    /**
     * Método que comprueba si los textbox correspondientes a la clave
     * del zoo están rellenos.
     *
     * @return <true> Si la clave se he rellenado
     *          <false> Si la clave no se ha rellenado
     */
    private boolean checkClaveZoo() {
        if (tbIdZoo.getText().compareTo("") == 0) {
            JOptionPane.showMessageDialog(this, "No se ha rellenado la infor" +
                    "mación identificativa del zoo. Por favor, " +
                    "rellene los campos que se indican en rojo.", "Error",
                    JOptionPane.ERROR_MESSAGE);
            paintZoo();
            return false;
        }
        paintZoo();
        return true;
    }

    /**
     * Método que comprueba si los textbox correspondientes a la clave
     * del animal están rellenos.
     *
     * @return <true> Si la clave se he rellenado
     *          <false> Si la clave no se ha rellenado
     */
    private boolean checkClaveAnimal() {
        if (tbAnimalEspecie.getText().compareTo("") == 0 ||
                tbAnimalNombre.getText().compareTo("") == 0) {
            JOptionPane.showMessageDialog(this, "No se ha rellenado la infor" +
                    "mación identificativa del animal. Por favor, " +
                    "rellene los campos que se indican en rojo.", "Error",
                    JOptionPane.ERROR_MESSAGE);
            paintAnimal();
            return false;
        }
        paintAnimal();
        return true;
    }

    /**
     * Método que pinta de rojo los textbox de animal necesarios para la
     * ejecución que no se han rellenado y sin los que se puede proseguir.
     */
    private void paintAnimal() {
        if (tbAnimalEspecie.getText().compareTo("") == 0) {
            tbAnimalEspecie.setBackground(new java.awt.Color(255, 102, 102));
        } else {
            tbAnimalEspecie.setBackground(new java.awt.Color(255, 255, 255));
        }
        if (tbAnimalNombre.getText().compareTo("") == 0) {
            tbAnimalNombre.setBackground(new java.awt.Color(255, 102, 102));
        } else {
            tbAnimalNombre.setBackground(new java.awt.Color(255, 255, 255));
        }
    }

    /**
     * Método que pinta de rojo los textbox de empleado necesarios para la
     * ejecución que no se han rellenado y sin los que se puede proseguir.
     */
    private void paintEmpleado() {
        if (tbEmpleadoId.getText().compareTo("") == 0) {
            tbEmpleadoId.setBackground(new java.awt.Color(255, 102, 102));
        } else {
            tbEmpleadoId.setBackground(new java.awt.Color(255, 255, 255));
        }
    }

    /**
     * Método que pinta de rojo los textbox de horario necesarios para la
     * ejecución que no se han rellenado y sin los que se puede proseguir.
     */
    private void paintHorario() {
        if (tbHorarioAnimal.getText().compareTo("") == 0) {
            tbHorarioAnimal.setBackground(new java.awt.Color(255, 102, 102));
        } else {
            tbHorarioAnimal.setBackground(new java.awt.Color(255, 255, 255));
        }
        if (tbHorarioHora.getText().compareTo("") == 0) {
            tbHorarioHora.setBackground(new java.awt.Color(255, 102, 102));
        } else {
            tbHorarioHora.setBackground(new java.awt.Color(255, 255, 255));
        }
        if (tbHorarioEspecie.getText().compareTo("") == 0) {
            tbHorarioEspecie.setBackground(new java.awt.Color(255, 102, 102));
        } else {
            tbHorarioEspecie.setBackground(new java.awt.Color(255, 255, 255));
        }
    }

    /**
     * Método que pinta de rojo los textbox de sala necesarios para la
     * ejecución que no se han rellenado y sin los que se puede proseguir.
     */
    private void paintSala() {
        if (tbSalaId.getText().compareTo("") == 0) {
            tbSalaId.setBackground(new java.awt.Color(255, 102, 102));
        } else {
            tbSalaId.setBackground(new java.awt.Color(255, 255, 255));
        }
    }

    /**
     * Método que pinta de rojo los textbox de ticket necesarios para la
     * ejecución que no se han rellenado y sin los que se puede proseguir.
     */
    private void paintTicket() {
        if (tbTicketZoo.getText().compareTo("") == 0) {
            tbTicketZoo.setBackground(new java.awt.Color(255, 102, 102));
        } else {
            tbTicketZoo.setBackground(new java.awt.Color(255, 255, 255));
        }
        if (tbTicketTipo.getSelectedItem().toString().compareTo("---") == 0) {
            tbTicketTipo.setBackground(new java.awt.Color(255, 102, 102));
        } else {
            tbTicketTipo.setBackground(new java.awt.Color(255, 255, 255));
        }
    }

    /**
     * Método que pinta de zoo los textbox de animal necesarios para la
     * ejecución que no se han rellenado y sin los que se puede proseguir.
     */
    private void paintZoo() {
        if (tbIdZoo.getText().compareTo("") == 0) {
            tbIdZoo.setBackground(new java.awt.Color(255, 102, 102));
        } else {
            tbIdZoo.setBackground(new java.awt.Color(255, 255, 255));
        }
    }

    /**
     * Método que vacía todos los textbox de la tabla de horarios y pone el
     * color al por defecto (blanco), que podría haber sido cambiado a rojo
     * durante la ejecución.
     */
    private void removeDatosHorario() {
        tbHorarioAnimal.setText("");
        tbHorarioAnimal.setBackground(new java.awt.Color(255, 255, 255));
        tbHorarioHora.setText("");
        tbHorarioHora.setBackground(new java.awt.Color(255, 255, 255));
        tbHorarioEspecie.setText("");
        tbHorarioEspecie.setBackground(new java.awt.Color(255, 255, 255));
        tbHorarioTipoComida.setSelectedIndex(0);
        tbHorarioTipoComida.setBackground(new java.awt.Color(255, 255, 255));
    }

    /**
     * Método que vacía todos los textbox de la tabla de sala y pone el
     * color al por defecto (blanco), que podría haber sido cambiado a rojo
     * durante la ejecución.
     */
    private void removeDatosSala() {
        tbSalaId.setText("");
        tbSalaId.setBackground(new java.awt.Color(255, 255, 255));
        tbSalaZoo.setText("");
        tbSalaZoo.setBackground(new java.awt.Color(255, 255, 255));
        tbSalaAforo.setText("");
        tbSalaAforo.setBackground(new java.awt.Color(255, 255, 255));
        tbSalaNombre.setText("");
        tbSalaNombre.setBackground(new java.awt.Color(255, 255, 255));
    }

    /**
     * Método que vacía todos los textbox de la tabla de tickets y pone el
     * color al por defecto (blanco), que podría haber sido cambiado a rojo
     * durante la ejecución.
     */
    private void removeDatosTicket() {
        tbTicketZoo.setText("");
        tbTicketZoo.setBackground(new java.awt.Color(255, 255, 255));
        tbTicketTipo.setSelectedIndex(0);
        tbTicketTipo.setBackground(new java.awt.Color(255, 255, 255));
        tbTicketPrecio.setText("");
        tbTicketPrecio.setBackground(new java.awt.Color(255, 255, 255));
    }

    /**
     * Método que vacía todos los textbox de la tabla de zoos y pone el
     * color al por defecto (blanco), que podría haber sido cambiado a rojo
     * durante la ejecución.
     */
    private void removeDatosZoo() {
        tbIdZoo.setText("");
        tbIdZoo.setBackground(new java.awt.Color(255, 255, 255));
        tbZooNombre.setText("");
        tbZooNombre.setBackground(new java.awt.Color(255, 255, 255));
        tbZooCiudad.setText("");
        tbZooCiudad.setBackground(new java.awt.Color(255, 255, 255));
        tbZooAforo.setText("");
        tbZooAforo.setBackground(new java.awt.Color(255, 255, 255));
        tbZooPais.setText("");
        tbZooPais.setBackground(new java.awt.Color(255, 255, 255));
        tbZooIdioma.setText("");
        tbZooIdioma.setBackground(new java.awt.Color(255, 255, 255));
        tbZooEntradas.setText("");
        tbZooEntradas.setBackground(new java.awt.Color(255, 255, 255));
    }

    /**
     * Método que vacía todos los textbox de la tabla de animales y pone el
     * color al por defecto (blanco), que podría haber sido cambiado a rojo
     * durante la ejecución.
     */
    private void removeDatosAnimal() {
        tbAnimalEspecie.setText("");
        tbAnimalEspecie.setBackground(new java.awt.Color(255, 255, 255));
        tbAnimalNombre.setText("");
        tbAnimalNombre.setBackground(new java.awt.Color(255, 255, 255));
        tbAnimalExtincion.setSelectedIndex(0);
        tbAnimalExtincion.setBackground(new java.awt.Color(255, 255, 255));
        tbAnimalPais.setText("");
        tbAnimalPais.setBackground(new java.awt.Color(255, 255, 255));
        tbAnimalSala.setText("");
        tbAnimalSala.setBackground(new java.awt.Color(255, 255, 255));
        tbAnimalEdad.setText("");
        tbAnimalEdad.setBackground(new java.awt.Color(255, 255, 255));
        tbAnimalEnfermedad.setSelectedIndex(0);
        tbAnimalEnfermedad.setBackground(new java.awt.Color(255, 255, 255));
        tbAnimalDescripcion.setText("");
        tbAnimalDescripcion.setBackground(new java.awt.Color(255, 255, 255));
    }

    /**
     * Método que vacía todos los textbox de la tabla de empleados y pone el
     * color al por defecto (blanco), que podría haber sido cambiado a rojo
     * durante la ejecución.
     */
    private void removeDatosEmpleado() {
        tbEmpleadoId.setText("");
        tbEmpleadoId.setBackground(new java.awt.Color(255, 255, 255));

        tbEmpleadoEdad.setText("");
        tbEmpleadoEdad.setBackground(new java.awt.Color(255, 255, 255));
        tbEmpleadoTelefono.setText("");
        tbEmpleadoTelefono.setBackground(new java.awt.Color(255, 255, 255));
        tbEmpleadoApellido2.setText("");
        tbEmpleadoApellido2.setBackground(new java.awt.Color(255, 255, 255));
        tbEmpleadoApellido1.setText("");
        tbEmpleadoApellido1.setBackground(new java.awt.Color(255, 255, 255));
        tbEmpleadoNombre.setText("");
        tbEmpleadoNombre.setBackground(new java.awt.Color(255, 255, 255));
        tbEmpleadoEspecialidad.setSelectedIndex(0);
        tbEmpleadoEspecialidad.setBackground(new java.awt.Color(255, 255, 255));
        tbEmpleadoEstado.setSelectedIndex(0);
        tbEmpleadoEstado.setBackground(new java.awt.Color(255, 255, 255));
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bAnimalAnyadir;
    private javax.swing.JButton bAnimalBorrar;
    private javax.swing.JButton bAnimalModificar;
    private javax.swing.JButton bEmpleadoAnyadir;
    private javax.swing.JButton bEmpleadoBorrar;
    private javax.swing.JButton bEmpleadoModificar;
    private javax.swing.JButton bHorarioAnyadir;
    private javax.swing.JButton bHorarioBorrar;
    private javax.swing.JButton bHorarioModificar;
    private javax.swing.JButton bIrConsultas;
    private javax.swing.JButton bSalaAnyadir;
    private javax.swing.JButton bSalaBorrar;
    private javax.swing.JButton bSalaModificar;
    private javax.swing.JButton bTicketAnyadir;
    private javax.swing.JButton bTicketBorrar;
    private javax.swing.JButton bTicketModificar;
    private javax.swing.JButton bZooAnyadir;
    private javax.swing.JButton bZooBorrar;
    private javax.swing.JButton bZooModificar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane3;
    private javax.swing.JEditorPane tbAnimalDescripcion;
    private javax.swing.JTextField tbAnimalEdad;
    private javax.swing.JComboBox tbAnimalEnfermedad;
    private javax.swing.JTextField tbAnimalEspecie;
    private javax.swing.JComboBox tbAnimalExtincion;
    private javax.swing.JTextField tbAnimalNombre;
    private javax.swing.JTextField tbAnimalPais;
    private javax.swing.JTextField tbAnimalSala;
    private javax.swing.JTextField tbEmpleadoApellido1;
    private javax.swing.JTextField tbEmpleadoApellido2;
    private javax.swing.JTextField tbEmpleadoEdad;
    private javax.swing.JComboBox tbEmpleadoEspecialidad;
    private javax.swing.JComboBox tbEmpleadoEstado;
    private javax.swing.JTextField tbEmpleadoId;
    private javax.swing.JTextField tbEmpleadoNombre;
    private javax.swing.JTextField tbEmpleadoTelefono;
    private javax.swing.JTextField tbHorarioAnimal;
    private javax.swing.JTextField tbHorarioEspecie;
    private javax.swing.JTextField tbHorarioHora;
    private javax.swing.JComboBox tbHorarioTipoComida;
    private javax.swing.JTextField tbIdZoo;
    private javax.swing.JTextField tbSalaAforo;
    private javax.swing.JTextField tbSalaId;
    private javax.swing.JTextField tbSalaNombre;
    private javax.swing.JTextField tbSalaZoo;
    private javax.swing.JTextField tbTicketPrecio;
    private javax.swing.JComboBox tbTicketTipo;
    private javax.swing.JTextField tbTicketZoo;
    private javax.swing.JTextField tbZooAforo;
    private javax.swing.JTextField tbZooCiudad;
    private javax.swing.JTextField tbZooEntradas;
    private javax.swing.JTextField tbZooIdioma;
    private javax.swing.JTextField tbZooNombre;
    private javax.swing.JTextField tbZooPais;
    // End of variables declaration//GEN-END:variables
}
